fn destroy_box(b: Box<i32>) {
    println!("Destroying box with value {}", b);
}

fn main() {
    let  x = 5u32;
    // 基础类型走的是copy，所以y=x的类型也是u32
    let y = x;

    println!("x: {}, y: {}", x, y);

    let a = Box::new(5i32);

    println!("a: {}", a);

    let b = a;

    // ERROR:指针a被copy，a=b的指针
    // println!("a: {}", a);

    // 转移所有权
    destroy_box(b);
}